<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>题目描述</title>
    <link rel="stylesheet" href="Public/layui/css/layui.css">
</head>
<body >

<div style="margin:0 auto; width:80%;  ">
    <div class="layui-field-box">
        <a href="javascript:history.go(-1);" class="layui-btn">
            <i class="layui-icon">&#xe65c;返回</i>
        </a>
    </div>

    <div class="layui-collapse">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title"><{$examination_list.id}>、<{$examination_list.title}></h2>
            <div class="layui-colla-content layui-show"><{$examination_list.subject}></div>
        </div>
    </div>


        <div class="site-title">
            <fieldset class="layui-elem-field">
                <legend>输入范例</legend>
                <pre class="layui-code"><{$examination_list.input}></pre>

            </fieldset>
        </div>

    <div class="layui-form">
        <div class="layui-input-inline">
            <select id="lang" name="lang" lay-verify="" >
                <option onclick="editLang('c_cpp')" selected value="c_cpp">C_C++</option>
                <option onclick="editLang('java')" value="java">Java</option>
            </select>

        </div>
        <a href="javascript:editLang();" class="layui-btn" >确定</a>
    </div>
    <input type="hidden" name="examination_id" id="examination_id" value="<{$examination_list.id}>" >
    <div id="editorCode"style=";width: 100%; height:400px;"></div>
    <div style="float:right" class="layui-btn-group">
        <a href="javascript:editCode_fontSize();" class="layui-btn layui-btn-small">
            <i class="layui-icon">字体+</i>
        </a>
        <a href="javascript:editCode_subtract();" class="layui-btn layui-btn-small">
            <i class="layui-icon">字体-</i>
        </a>
        <a href="javascript:submit();" class="layui-btn layui-btn-small">
            <i class="layui-icon">提交</i>
        </a>
    </div>
    <br>



</div>

<script src="Public/Common/Js/jquery-2.1.0.min.js"></script>
<script src="Public/layui/layui.js"></script>
<script src="Public/ace-builds-master/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>


<script>
    layui.use(['layer', 'form','element','code'], function(){
        var layer = layui.layer,form = layui.form,element = layui.element;
        layui.code({
            title: '输入范例',
            about:false
        });
    });

    var Code_fontSize = 15;

    var editor = ace.edit("editorCode");
    editor.setTheme("ace/theme/monokai");
    editor.getSession().setMode("ace/mode/c_cpp");
    editor.setTheme("ace/theme/twilight");
    document.getElementById('editorCode').style.fontSize='15px';

    function editCode_fontSize() {
        Code_fontSize++;
        document.getElementById('editorCode').style.fontSize=Code_fontSize+'px';
    }
    function editCode_subtract() {
        if(Code_fontSize>10){
            Code_fontSize--;
        }
        document.getElementById('editorCode').style.fontSize=Code_fontSize+'px';
    }


    function editLang() {
        editor.getSession().setMode("ace/mode/"+$("#lang").val());
        layer.msg("已切换到"+$("#lang").val()+"语言");
    }
    
    function submit() {
        $.post('',{},function () {

        });
    }
</script>
</body>
</html>